package com.sltx.controller;

import com.sltx.controller.base.BaseController;
import com.sltx.service.QypjService;
import com.sltx.util.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author Administrator
 * @Date 2023/4/12 9:17
 */
@Controller
@RequestMapping("/qypj")
@ResponseBody
public class QypjController extends BaseController {

    //注入service
    @Autowired
    private QypjService qypjService;



    //优质企业评价
    @RequestMapping("/youzhi")
    @ResponseBody
    public Map<String, Object> youzhi(){
        PageData pd = this.getPageData();
        Map<String, Object> map = new HashMap<String,Object>();
        //1.获取传来的企业名称
        String entName = (String) pd.get("entName");
        //2.通过企业名称查询
        map = qypjService.getYouzhiqy(entName);
        return map;
    }

    //潜力企业评价
    @RequestMapping("/qianli")
    @ResponseBody
    public Object qianli(){
        PageData pd = this.getPageData();
        //1.获取传来的企业名称
        String entName = (String) pd.get("entName");
        //通过企业名称查询
        return qypjService.getQianli(entName);
    }

    //预警企业风险
    @RequestMapping("/yujing")
    @ResponseBody
    public Object yujing(){
        PageData pd = this.getPageData();
        //通过企业名称查询和用户名
        return qypjService.getYujing(pd);
    }

    //企业分项指标详细数据
    @RequestMapping("/shuju")
    @ResponseBody
    public Object shuju(){
        PageData pd = this.getPageData();
        //通过月份，预警项，用户名，企业名
        return qypjService.getShuju(pd);
    }

    //查询此企业是什么企业
    @RequestMapping("/Qiye")
    @ResponseBody
    public Object getQiye(){
        PageData pd = this.getPageData();
        return qypjService.getQiye(pd);
    }


}
